//
//  SettingViewController.m
//  Spa
//
//  Created by PangPond on 10/1/2556.
//  Copyright (c) พ.ศ. 2556 innova. All rights reserved.
//

#import "SettingViewController.h"
#import "MenuViewController.h"
#import "StaffViewController.h"
#import "CustomerViewController.h"
#import "ProductViewController.h"
#import "MessageBedViewController.h"
#import "ReportViewController.h"
@interface SettingViewController ()

@end

@implementation SettingViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.title = @"Setting";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark - UITableViewDataSource


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
    return @"Settings";
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 7;
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    //////
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    //config xell
    if (indexPath.row == 0) {
        cell.textLabel.text = @"Menu";
    }else if (indexPath.row == 1) {
        cell.textLabel.text = @"Staff";
    }else if (indexPath.row == 2) {
        cell.textLabel.text = @"Customer";
    }else if (indexPath.row == 3) {
        cell.textLabel.text = @"Product";
    }else if (indexPath.row == 4) {
        cell.textLabel.text = @"Message Bed";
    }else if (indexPath.row == 5) {
        cell.textLabel.text = @"Report";
    }else{
        cell.textLabel.text = @"System";
    }
    
    //cell.accessoryType = UITableViewCellAccessoryNone;
    
    return cell;
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0) {
        MenuViewController *menu = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil];
        menu.title =@"Menu";
        [self.navigationController pushViewController:menu animated:YES];
        
    }else if (indexPath.row == 1) {
        StaffViewController *staff = [[StaffViewController alloc] initWithNibName:@"StaffViewController" bundle:nil];
        staff.title =@"Staff";
        [self.navigationController pushViewController:staff animated:YES];
        
    }else if (indexPath.row == 2) {
        CustomerViewController *customer = [[CustomerViewController alloc] initWithNibName:@"CustomerViewController" bundle:nil];
        customer.title =@"Customer";
        [self.navigationController pushViewController:customer animated:YES];
        
    }else if (indexPath.row == 3) {
        ProductViewController *product = [[ProductViewController alloc] initWithNibName:@"ProductViewController" bundle:nil];
        product.title =@"Product";
        [self.navigationController pushViewController:product animated:YES];
        
    }else if (indexPath.row == 4) {
        MessageBedViewController *messageBed = [[MessageBedViewController alloc] initWithNibName:@"MessageBedViewController" bundle:nil];
        messageBed.title =@"Message Bed";
        [self.navigationController pushViewController:messageBed animated:YES];
        
    }else if (indexPath.row == 5) {
        ReportViewController *report = [[ReportViewController alloc] initWithNibName:@"ReportViewController" bundle:nil];
        report.title =@"Report";
        [self.navigationController pushViewController:report animated:YES];
    }else{
        
    }
    
}

@end
